# -*- coding: utf-8 -*-
from PhysicObject import *

class Beam(PhysicObject):
    image = load_image('images/end.png')

    def __init__(self, world, (xi, yi), (xf, yf)):
        self.world = world
        
        #calculo x,y  centro
        x =         
        
        bodyDef = box2d.b2BodyDef()
        bodyDef.position = (x, y)
        bodyDef.userData = self
        self.body = self.world.world.CreateBody(bodyDef)
        shapeDef = box2d.b2PolygonDef()
        shapeDef.SetAsBox(2.0, 0.2)
        self.body.CreateShape(shapeDef)
       
    def draw( self, surface, offset_x, offset_y ):
        pos = self.body.GetPosition()
        #pos = self.body.GetLocalCenter()
        print pos
        
        #surface.blit(self.image, (int(pos.x*10)-offset_x,
        #                          int(pos.y*10)-offset_y))
        pygame.draw.line(surface, (255,255,255), 
                ((pos.x+2)*10, (pos.y+0.1)*10), ((pos.x-2)*10,(pos.y+0.1)*10),5)

